-- GENERATED SPELL FOR [Forgotten Depths Underking] --


function spell0_31039(pUnit, Event) --@Blinding Swarm,Self--
pUnit:FullCastSpellOnTarget(50284,pUnit)
pUnit:RegisterEvent('Sorts_31039', 5000, 1)
end

function spell1_31039(pUnit, Event) --@Mandible Crush,Self--
pUnit:FullCastSpellOnTarget(60802,pUnit)
pUnit:RegisterEvent('Sorts_31039', 650, 1)
end

function Sorts_31039(pUnit, Event)
local choix_sorts_31039 = math.random(0, 1)
if choix_sorts_31039 == 0 then
pUnit:RegisterEvent('spell0_31039', 1, 1)
end
if choix_sorts_31039 == 1 then
pUnit:RegisterEvent('spell1_31039', 1, 1)
end
end

function mob31039_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31039', math.random(1500, 3000), 1)
end

function mob31039_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31039_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31039_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31039, 1, 'mob31039_Action')
RegisterUnitEvent(31039, 2, 'mob31039_Leave')
RegisterUnitEvent(31039, 3, 'mob31039_Kill')
RegisterUnitEvent(31039, 4, 'mob31039_Die')
